var http=require('http');
http.createServer(function (req, res) {
    var split_url=req.url.split("/");
    if ( split_url[1] == '' ) {
	res.writeHead(200, {'Content-Type': 'text/plain'});
	res.end('Portada');
    } else if ( split_url[1] == 'proc' ) {
	res.writeHead(200, {'Content-Type': 'text/plain'});
	res.end('No es la portada');
    } else {
	res.writeHead(404, {'Content-Type': 'text/plain'});
	res.end('No entiendo la petición');
    }
}).listen(8080, '127.0.0.1');
console.log('Server running at http://127.0.0.1:8080/');
